package com.hemaapp.yjnh.nettask;

import com.google.gson.Gson;
import com.hemaapp.hm_FrameWork.result.HemaPageArrayResult;
import com.hemaapp.yjnh.BaseHttpInformation;
import com.hemaapp.yjnh.BaseNetTask;
import com.hemaapp.yjnh.bean.FarmerReturnOrder;

import org.json.JSONObject;

import java.util.HashMap;

import xtom.frame.exception.DataParseException;

public class FarmerReturnOrderListTask extends BaseNetTask {

	public FarmerReturnOrderListTask(BaseHttpInformation information,
									 HashMap<String, String> params) {
		super(information, params);
	}

	public FarmerReturnOrderListTask(BaseHttpInformation information,
									 HashMap<String, String> params, HashMap<String, String> files) {
		super(information, params, files);
	}

	@Override
	public Object parse(JSONObject jsonObject) throws DataParseException {
		return new Result(jsonObject);
	}
	
	private class Result extends HemaPageArrayResult<FarmerReturnOrder> {

		public Result(JSONObject jsonObject) throws DataParseException {
			super(jsonObject);
		}

		@Override
		public FarmerReturnOrder parse(JSONObject jsonObject) throws DataParseException {
			return new Gson().fromJson(jsonObject.toString(), FarmerReturnOrder.class);
		}

	}
}
